#include<stdio.h>
#include <string.h>
#define rep(x,s,t) for(x=s;x<=t;x++)

char str[1000];
int i,j,k,cmp;
int tot = 0;
int Cap,alph,num,space,other = 0;

int main(){
	while (gets(str) && strcmp(str,"end")){
		rep(i,0,strlen(str)-1){
			if (str[i]>='A' && str[i]<='Z')	Cap++;
			if (str[i]>='a' && str[i]<='z') alph++;
			if (str[i]>='0' && str[i]<='9') num ++;
			if (str[i]==' ')	space ++;
		}
		tot += strlen(str);
	}
	tot = tot-Cap-alph-num-space;
	printf("大写字母有%d个\n",Cap);
	printf("小写字母有%d个\n",alph);
	printf("数字有%d个\n",num);
	printf("空格有%d个\n",space);
	printf("其他字符有%d个\n",tot);
} 